package com.sgb.kjwl.model.entity.self;

import android.text.TextUtils;

import com.sgb.kjwl.model.entity.CarInfo;
import com.sgb.kjwl.model.entity.transport.OfferGoodsSourcePlaceEntity;
import com.sgb.kjwl.utils.NumberUtil;

import java.util.List;

/**
 * Describe:    报价或者接单信息类
 * Author:  yangLei
 * Date:    2021/4/13
 */
public class OrderQuoteEntity {
    //货源no
    private String sourceNo;
    //货源货物类型
    private String goodsTypeName;
    //货源 重量
    private String weight;
    //货源 体积
    private String volume;
    //货源 信息费
    private String sourceMessagePrice;
    //货源 总运费
    private String sourceAllFreight;
    //报价截止时间
    private String endTime;
    /**
     * 报价状态：
     * 普通货源——1已报价  2待支付(已同意)  3已支付 4超时未支付 5已失效/货主未同意
     * 竞价货源——1已报价  2已同意  5货主未同意
     */
    private String offerStatus;
    //车主userNo
    private String userNo;
    //报价 总运费
    private String allFreight;
    //报价 车牌号
    private String carNumber;
    //报价 车型
    private String carTypeName;
    //报价 车长
    private String carLenName;
    //报价 栏高
    private String heightHurdle;
    //报价车辆位置 省
    private String provinceName;
    //报价车辆位置 市
    private String cityName;
    //报价车辆位置 区
    private String districtName;
    //报价车辆位置 详细地址
    private String detailAddress;
    //报价时间
    private String createTime;
    //报价no
    private String goodsOfferNo;
    //订单no
    private String orderNo;
    //车主姓名
    private String name;
    //报价方的IM账号手机号
    private String telphone;
    //报价方的IM账号
    private String imAccount;
    //
    private String imToken;
    //货源装卸地
    private OfferGoodsSourcePlaceEntity place;
    //经度
    private Double longitude;
    //纬度
    private Double latitude;
    //距离
    private String distance;

    //	附件 图片 逗号隔开
    private String accessory;
    //运费报价
    private String goodsSourceFreight;
    //货源 装卸方式
    private String handleTypeNo;
    //头像
    private String headImg;
    //	是否货源发布人查看 1: 是 0: 否
    private int isGoodsSourceIssuer;

    //报价类型 ：1 企业 2 团队 3 个人
    private String offerType;
    //团队名称
    private String teamName;
    //团队no
    private String teamNo;
    //企业名称
    private String companyName;
    //企业no
    private String companyNo;
    //报价 单价
    private String freight;
    //报价方的价格单位:     1：元/趟，2：元/吨，3：元/方
    private Integer quotationFreightUnit;
    //货源 单价
    private String sourceFreight;
    //货源 单价单位
    private Integer freightUnit;//1：元/趟，2：元/吨，3：元/方
    //报价单位名字
    private String biddingUnit;
    //团队或者公司地址
    private String companyTeamAddress;
    //logo(报价单位的头像统一取这个)
    private String logo;
    //	货主待处理同意报价截止时间
    private Long shipmentEndTime;
    //是否本人报价:1-本人   0-其他人
    private String isSelfOffer;
    //报价 0    接单 2
    private int isVoluntarily;
    //到场时间
    private Long inTime;
    //联系人
    private String contacts;
    //联系人电话
    private String contactsNumber;

    //报价单位类型
    private String quotedPriceObject;

    //报价失效原因
    private Integer failureCause;

    //是否已同意报价
    private boolean isAgree;
    private Integer isDumper;//是否自卸 0:非自卸 1:自卸

    private String freightType;//0——一口价，1——电议
    private String driverNo;
    private String carOfferNo;
    private String note;
    private List<AddField> diyField;

    //承运车辆集合
    private List<DriverAuth> driverAuths;

    public void setQuotationFreightUnit(Integer quotationFreightUnit) {
        this.quotationFreightUnit = quotationFreightUnit;
    }

    public String getMessagePrice() {
        return messagePrice;
    }

    public void setMessagePrice(String messagePrice) {
        this.messagePrice = messagePrice;
    }

    private String messagePrice;
    /**
     * 统计价格区间 1:报价高于P10%以内 2:报价高于P10%以上 3:报价低于P10%以内 4:报价低于P10%以上5:报价等于P 6:已成交
     */
    private Integer priceSection;

    public OrderQuoteEntity(Double longitude, Double latitude, String distance) {
        this.longitude = longitude;
        this.latitude = latitude;
        this.distance = distance;
    }

    public OrderQuoteEntity() {
    }

    public int getIsGoodsSourceIssuer() {
        return isGoodsSourceIssuer;
    }

    public void setIsGoodsSourceIssuer(int isGoodsSourceIssuer) {
        this.isGoodsSourceIssuer = isGoodsSourceIssuer;
    }

    public String getFreight() {
        return freight;
    }

    public void setFreight(String freight) {
        this.freight = freight;
    }

    public String getSourceFreight() {
        return sourceFreight;
    }

    public void setSourceFreight(String sourceFreight) {
        this.sourceFreight = sourceFreight;
    }

    public String getFreightUnit() {
        if (freightUnit == null) {
            return "元/吨";
        }
        if (freightUnit == 3) {
            return "元/方" + (TextUtils.isEmpty(volume) ? "" : "x" + NumberUtil.trim0(volume));
        } else if (freightUnit == 1) {
            return "元/趟 x 1";
        } else if (freightUnit == 2) {
            return "元/吨" + (TextUtils.isEmpty(weight) ? "" : "x" + NumberUtil.trim0(weight));
        } else
            return "元/吨";
    }

    public String getQuotationFreightUnit() {
        if (quotationFreightUnit == null) {
            return "元/吨";
        }
        if (quotationFreightUnit == 3) {
            return "元/方" + (TextUtils.isEmpty(volume) ? "" : "x" + NumberUtil.trim0(volume));
        } else if (quotationFreightUnit == 1) {
            return "元/趟 x 1";
        } else if (quotationFreightUnit == 2) {
            return "元/吨" + (TextUtils.isEmpty(weight) ? "" : "x" + NumberUtil.trim0(weight));
        } else
            return "元/吨";
    }

    public Integer getIsDumper() {
        return isDumper;
    }

    public void setIsDumper(Integer isDumper) {
        this.isDumper = isDumper;
    }

    public Integer getPriceSection() {
        return priceSection;
    }

    public void setPriceSection(Integer priceSection) {
        this.priceSection = priceSection;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getBiddingUnit() {
        return biddingUnit;
    }

    public void setBiddingUnit(String biddingUnit) {
        this.biddingUnit = biddingUnit;
    }

    public void setFreightUnit(Integer freightUnit) {
        this.freightUnit = freightUnit;
    }

    public String getAccessory() {
        return accessory;
    }

    public void setAccessory(String accessory) {
        this.accessory = accessory;
    }

    public String getCompanyName() {
        return companyName;
    }


    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyTeamAddress() {
        return companyTeamAddress;
    }

    public void setCompanyTeamAddress(String companyTeamAddress) {
        this.companyTeamAddress = companyTeamAddress;
    }

    public String getCompanyNo() {
        return companyNo;
    }

    public void setCompanyNo(String companyNo) {
        this.companyNo = companyNo;
    }

    public String getGoodsSourceFreight() {
        return goodsSourceFreight;
    }

    public void setGoodsSourceFreight(String goodsSourceFreight) {
        this.goodsSourceFreight = goodsSourceFreight;
    }

    public String getHandleTypeNo() {
        return handleTypeNo;
    }

    public void setHandleTypeNo(String handleTypeNo) {
        this.handleTypeNo = handleTypeNo;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    public String getOfferType() {
        if (offerType == null)
            return "";
        return offerType;
    }

    public void setOfferType(String offerType) {
        this.offerType = offerType;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public String getTeamNo() {
        return teamNo;
    }

    public void setTeamNo(String teamNo) {
        this.teamNo = teamNo;
    }

    public String getSourceNo() {
        return sourceNo;
    }

    public void setSourceNo(String sourceNo) {
        this.sourceNo = sourceNo;
    }

    public String getGoodsTypeName() {
        return goodsTypeName;
    }

    public void setGoodsTypeName(String goodsTypeName) {
        this.goodsTypeName = goodsTypeName;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getVolume() {
        return volume;
    }

    public void setVolume(String volume) {
        this.volume = volume;
    }

    public String getSourceMessagePrice() {
        return sourceMessagePrice;
    }

    public void setSourceMessagePrice(String sourceMessagePrice) {
        this.sourceMessagePrice = sourceMessagePrice;
    }

    public String getSourceAllFreight() {
        return sourceAllFreight;
    }

    public void setSourceAllFreight(String sourceAllFreight) {
        this.sourceAllFreight = sourceAllFreight;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getOfferStatus() {
        if (offerStatus == null)
            return "";
        return offerStatus;
    }

    public void setOfferStatus(String offerStatus) {
        this.offerStatus = offerStatus;
    }

    public String getUserNo() {
        return userNo;
    }

    public void setUserNo(String userNo) {
        this.userNo = userNo;
    }

    public String getAllFreight() {
        return allFreight;
    }

    public void setAllFreight(String allFreight) {
        this.allFreight = allFreight;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public String getCarTypeName() {
        return carTypeName;
    }

    public void setCarTypeName(String carTypeName) {
        this.carTypeName = carTypeName;
    }

    public String getCarLenName() {
        return carLenName;
    }

    public void setCarLenName(String carLenName) {
        this.carLenName = carLenName;
    }

    public String getHeightHurdle() {
        return heightHurdle;
    }

    public void setHeightHurdle(String heightHurdle) {
        this.heightHurdle = heightHurdle;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getDetailAddress() {
        return detailAddress;
    }

    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getGoodsOfferNo() {
        return goodsOfferNo;
    }

    public void setGoodsOfferNo(String goodsOfferNo) {
        this.goodsOfferNo = goodsOfferNo;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTelphone() {
        return telphone;
    }

    public void setTelphone(String telphone) {
        this.telphone = telphone;
    }

    public String getImAccount() {
        return imAccount;
    }

    public void setImAccount(String imAccount) {
        this.imAccount = imAccount;
    }

    public String getImToken() {
        return imToken;
    }

    public void setImToken(String imToken) {
        this.imToken = imToken;
    }

    public OfferGoodsSourcePlaceEntity getPlace() {
        return place;
    }

    public void setPlace(OfferGoodsSourcePlaceEntity place) {
        this.place = place;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        distance = distance;
    }

    public Long getShipmentEndTime() {
        return shipmentEndTime;
    }

    public void setShipmentEndTime(Long shipmentEndTime) {
        this.shipmentEndTime = shipmentEndTime;
    }

    public String getIsSelfOffer() {
        return isSelfOffer;
    }

    public void setIsSelfOffer(String isSelfOffer) {
        this.isSelfOffer = isSelfOffer;
    }

    public int getIsVoluntarily() {
        return isVoluntarily;
    }

    public void setIsVoluntarily(int isVoluntarily) {
        this.isVoluntarily = isVoluntarily;
    }

    public String getQuotedPriceObject() {
        return quotedPriceObject;
    }

    public void setQuotedPriceObject(String quotedPriceObject) {
        this.quotedPriceObject = quotedPriceObject;
    }

    public Long getInTime() {
        return inTime;
    }

    public void setInTime(Long inTime) {
        this.inTime = inTime;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getContactsNumber() {
        return contactsNumber;
    }

    public void setContactsNumber(String contactsNumber) {
        this.contactsNumber = contactsNumber;
    }

    public Integer getFailureCause() {
        return failureCause;
    }

    public void setFailureCause(Integer failureCause) {
        this.failureCause = failureCause;
    }

    public boolean isAgree() {
        return isAgree;
    }

    public void setAgree(boolean agree) {
        isAgree = agree;
    }

    public String getDriverNo() {
        return driverNo;
    }

    public void setDriverNo(String driverNo) {
        this.driverNo = driverNo;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public List<AddField> getDiyField() {
        return diyField;
    }

    public void setDiyField(List<AddField> diyField) {
        this.diyField = diyField;
    }

    public String getCarOfferNo() {
        return carOfferNo;
    }

    public void setCarOfferNo(String carOfferNo) {
        this.carOfferNo = carOfferNo;
    }

    public String getFreightType() {
        return freightType;
    }

    public void setFreightType(String freightType) {
        this.freightType = freightType;
    }

    public String getIsDump() {
        if (isDumper == null)
            return "";
        if (isDumper == 1) {
            return "自卸";
        } else {
            return "非自卸";
        }
    }

    public void setIsDump(Integer isDump) {
        this.isDumper = isDump;
    }

    public List<DriverAuth> getDriverAuths() {
        return driverAuths;
    }

    public void setDriverAuths(List<DriverAuth> driverAuths) {
        this.driverAuths = driverAuths;
    }

    public class DriverAuth {
        //车牌号
        private String carNumber;
        //车型
        private String carTypeName;
        //车长
        private String carLenName;
        //栏高
        private String heightHurdle;
        //是否自卸 0:非自卸 1:自卸
        private Integer isDump;

        public String getCarNumber() {
            return carNumber;
        }

        public String getCarTypeName() {
            return carTypeName;
        }

        public String getCarLenName() {
            return carLenName;
        }

        public String getHeightHurdle() {
            return heightHurdle;
        }

        public String getIsDumper() {
            if (isDump == null)
                return "";
            if (isDump == 1) {
                return "自卸";
            } else {
                return "非自卸";
            }
        }
    }
}
